<%@page import="com.news.entity.News"%>
<%@page import="java.util.List"%>
<%@page import="com.news.dao.impl.NewsDaoImpl"%>
<%@page import="com.news.dao.NewsDao"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%
//java 注释
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss E");
%>


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<!--  这里注释 -->
	<%--  这里jsp注释 
http://localhost:8080/newsweb/index.jsp //绝对路径
index.jsp								//相对路径
/newsweb/....
--%>
	<a href="">首页</a>(当前时间：<%=sdf.format(date)%>)
	<a href="login.jsp">登录</a>
	<h3>
		快速进入分类通道 
		<a href="go.jsp?id=1">1</a>
		<a href="go.jsp?id=2">2</a>
		<a href="go.jsp?id=3">3</a>
		<a href="go.jsp?id=4">4</a>
		<a href="go.jsp?id=5">5</a>
	</h3>
	<hr>用户：<a href="/newsweb/user/login">登录</a>|<a href="/newsweb/user/logout">退出 </a>|<a href="/newsweb/user/update">修改</a>
	<a href="http://localhost:8080/newsweb/a/a.jsp">a.jsp</a>
	<a href="a/a.jsp">a.jsp2</a>
	<a href="/newsweb/a/a.jsp">a.jsp3</a>
	<a href="/newsweb/a/b/b.jsp">b.jsp</a>

	<hr>
	<%-- 显示当前所有的新闻内容 --%>
	<%@include file="types.jsp"%>
	<%
	NewsDao ndao = new NewsDaoImpl();
	List<News> newslist = ndao.getAllNews();
	for (News news : newslist) {
		out.print(news + "<br>");
	}
	%>
</body>
</html>